<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <h2>{{message}}</h2>

    <my-cpn></my-cpn>
    <my-cpn-t></my-cpn-t>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script>
    // 全局注册语法糖
    Vue.component('MyCpn', {
        template: `
            <div>
                <h2>全局注册组件语法糖</h2>
            </div>
        `
    })
    const app = new Vue({
        el: '#app',
        data: {
            message: 'simplelu'
        },
        // 局部注册语法糖
        components: {
            'my-cpn-t': {
                template: `
            <div>
                <h2>局部注册组件语法糖</h2>
            </div>
        `
            }
        }
    })
</script>
</body>
</html>